In a data processing system, if more than one process or “thread” requires access to shared data, a synchronization mechanism is used to coordinate access to the shared data among different threads. The synchronization mechanism is necessary to prevent one thread from modifying the shared data before another thread has finished working with the shared data, such as a read-after write hazard among other types of shared data conditions to avoid. In some multi-threaded systems, a “task scheduling program” is used to control execution of the multiple threads and access to shared data among the multiple threads. A task scheduling program is typically executed by an operating system that runs on the data processing system.
Synchronization of shared data becomes more complex if multiple threads run on physically distinct processors in a multiprocessor system that accesses the shared data from a shared memory. For example, the processors may be executing threads independent from one another, such that each of the processors is unaware of the specific thread or threads being executed by the other processors. In addition, there may be no operating system present to control operation of the multiple processors. Since each of the processors is executing independent code, a task scheduler may not be extendable across all processor platforms. Without a task scheduler, such as a task scheduling program, the processors may interfere with one another while attempting to modify data stored in the shared memory.
Accordingly, it would be both desirable and useful to process data stored in a memory shared among a plurality of processors that execute independent threads.